package org.openwork.portlet.skillmanagement.service;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.util.ClassLoaderProxy;


/**
 * <a href="SkillUserServiceUtil.java.html"><b><i>View Source</i></b></a>
 *
 * <p>
 * ServiceBuilder generated this class. Modifications in this class will be
 * overwritten the next time is generated.
 * </p>
 *
 * <p>
 * This class provides static methods for the
 * {@link SkillUserService} bean. The static methods of
 * this class calls the same methods of the bean instance. It's convenient to be
 * able to just write one line to call a method on a bean instead of writing a
 * lookup call and a method call.
 * </p>
 *
 * @author    Samuel Garcia Martinez
 * @see       SkillUserService
 * @generated
 */
public class SkillUserServiceUtil {
    private static SkillUserService _service;

    public static org.openwork.portlet.skillmanagement.model.SkillUser addSkillUser(
        long auditUserId, long userId, long skillId, short experience)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .addSkillUser(auditUserId, userId, skillId, experience);
    }

    public static org.openwork.portlet.skillmanagement.model.SkillUser updateSkillUser(
        long auditUserId, long userId, long skillId, short experience)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .updateSkillUser(auditUserId, userId, skillId, experience);
    }

    public static int searchCountByUserId(long userId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().searchCountByUserId(userId);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.SkillUser> searchByUserId(
        long userId, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().searchByUserId(userId, start, end, orderByComparator);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.SkillUser> searchByUserId(
        long userId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().searchByUserId(userId);
    }

    public static int searchCountBySkillId(long skillId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().searchCountBySkillId(skillId);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.SkillUser> searchBySkillId(
        long skillId)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService().searchBySkillId(skillId);
    }

    public static java.util.List<org.openwork.portlet.skillmanagement.model.SkillUser> searchBySkillId(
        long skillId, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws com.liferay.portal.kernel.exception.PortalException,
            com.liferay.portal.kernel.exception.SystemException {
        return getService()
                   .searchBySkillId(skillId, start, end, orderByComparator);
    }

    public static void clearService() {
        _service = null;
    }

    public static SkillUserService getService() {
        if (_service == null) {
            Object obj = PortletBeanLocatorUtil.locate(ClpSerializer.SERVLET_CONTEXT_NAME,
                    SkillUserService.class.getName());
            ClassLoader portletClassLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.SERVLET_CONTEXT_NAME,
                    "portletClassLoader");

            ClassLoaderProxy classLoaderProxy = new ClassLoaderProxy(obj,
                    SkillUserService.class.getName(), portletClassLoader);

            _service = new SkillUserServiceClp(classLoaderProxy);

            ClpSerializer.setClassLoader(portletClassLoader);
        }

        return _service;
    }

    public void setService(SkillUserService service) {
        _service = service;
    }
}
